import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/order',
    name: 'order',
    meta,
    redirect: { name: 'order' },
    component: layoutHeaderAside,
    children: (pre => [
		{
		    path: 'salesSummary',
		    name: `${pre}salesSummary`,
		    component: _import('order/shopOrderSummary'),
		    meta: {
		        ...meta,
		        title: '销售数据统计'
		    }
		},
		{
		    path: 'allOrderList',
		    name: `${pre}allOrderList`,
		    component: _import('order/shopOrderAllList'),
		    meta: {
		        ...meta,
		        title: '各渠道订单汇总',
				cache: true,
		    }
		},
        {
            path: 'shopOrderList',
            name: `${pre}shopOrderList`,
            component: _import('order/shopOrderList'),
            meta: {
                ...meta,
                title: '门店订单列表',
				cache: true,
            }
        },
        {
            path: 'orderDetails',
            name: `${pre}orderDetails`,
            component: _import('order/orderDetails'),
            meta: {
                ...meta,
                title: '门店订单详情'
            }
        },
        {
            path: 'orderApplyAfterSale',
            name: `${pre}orderApplyAfterSale`,
            component: _import('order/orderApplyAfterSale'),
            meta: {
                ...meta,
                title: '订单售后申请'
            }
        },
        {
            path: 'orderAfterSaleDetail',
            name: `${pre}orderAfterSaleDetail`,
            component: _import('order/orderAfterSaleDetail'),
            meta: {
                ...meta,
                title: '订单售后详情'
            }
        },
        {
            path: 'mallOrderList',
            name: `${pre}mallOrderList`,
            component: _import('order/mallOrderList'),
            meta: {
                ...meta,
                title: '商城订单列表'
            }
        },
		{
		    path: 'exchangeOrderList',
		    name: `${pre}exchangeOrderList`,
		    component: _import('order/exchangeOrderList'),
		    meta: {
		        ...meta,
		        title: '兑换订单列表',
				cache: true,
		    }
		},
		{
		    path: 'inviteOrderList',
		    name: `${pre}inviteOrderList`,
		    component: _import('order/inviteOrderList'),
		    meta: {
		        ...meta,
		        title: '我请客订单',
				cache: true,
		    }
		},
    ])('order-')
}
